{include file="header/index" /}
<script type="text/javascript" src="__JS__/layui/layui.all.js"></script>
<link rel="stylesheet" href="__JS__/layui/css/layui.css" />
<style>
    table th,table td{
        text-align: left !important;
    }
    .export_time{
        float: left;
        display: flex;
    }
    .timewrap{
        display: flex;
        align-items: center;
    }
</style>
<div class="container whitebg">
    <div class="topnav clearfix">
        <div class="title fl">
            <h3>导出工单</h3>
        </div>
        <div class="backbtnwrap fr">
            <button type="button" class="btn backbtn" onclick="backurl(this)">返回</button>
        </div>
    </div>
    <div class="information" id="information">
        <p class="title">导出选择</p>
        <form action="{:url('Workorder/export')}" method="post">
                <div class="form-group">
                    <label style="margin-right: 10px">下单时间:</label>
                    <div class="timewrap">
                        <label>开始时间</label>
                        <input class="form-control input-time" type="text" name="datetimeStart" id="datetimeStart"readonly class="form_datetime">
                        <label style="margin-left: 20px;">结束时间</label>
                        <input class="form-control input-time" type="text" name="datetimeEnd" id="datetimeEnd" readonly class="form_datetime">
                    </div>
                </div>
                <div class="form-group">
                    <label>工单状态</label>
                    {foreach name="work_order_status" item="vo" key="k" }
                    <label class="checkbox-inline">
                        <input type="checkbox" name="state[]" value="{$k}"> {$vo} <!--无效-->
                    </label>
                    {/foreach}
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-default">导出</button>
                    <br />
                    <span>注：当数据量过多可能会导致失败，工单状态不选择表示选择全部</span>
                </div>



        </form >







    </div>



</div>
</body>

</html>
<script type="text/javascript">
    //日期选择
    $("#datetimeStart").datetimepicker({
        language: 'cn',
        format: "yyyy-mm-dd",
        autoclose: true,
        minView: "month",
        maxView: "decade",
        todayBtn: true,
        pickerPosition: "bottom-left"
    }).on("click", function(ev) {
        $("#datetimeStart").datetimepicker("setEndDate", $("#datetimeEnd").val());
    });
    $("#datetimeEnd").datetimepicker({
        language: 'cn',
        format: "yyyy-mm-dd",
        autoclose: true,
        minView: "month",
        maxView: "decade",
        todayBtn: true,
        pickerPosition: "bottom-left"
    }).on("click", function(ev) {
        $("#datetimeEnd").datetimepicker("setStartDate", $("#datetimeStart").val());
    });
    //返回上一页
    function backurl() {
        history.back();
    }

</script>